<?php
class Modules_Milestone_View_ShowMilestones
{
	public function draw()
	{
	
		$fields=array("Id","Name","Start","End","Actions");
		$header=new Modules_Common_Design_RowsHeader($fields);
		$table= new Modules_Common_Design_Table($header);
		$result=Modules_Common_DB_ProjectHasMilestones::SearchByProject($_SESSION['project']);
		foreach($result as $value)
		{
			$value= new Modules_Common_DB_Milestones($value->milestones_id);
			$rows=new Modules_Common_Design_Rows($header);
			$row=array(
							"Id"=>$value->id,
							"Name"=>$value->name,
							"Start"=>date("d/m/y",$value->start),
							"End"=>date("d/m/y",$value->end),
							"Actions"=>""
			);
			$rows->setRow($row);
			$table->AddRows($rows);
		}
		
		echo  $table->draw();
		
	}
}
	